package util

import (
	v1 "k8s.io/api/apps/v1"
	"operator/pkg/types/mesh"
)

func DeploymentStatus(obj *v1.Deployment) mesh.MeshStartStatus {
	if obj.Status.UnavailableReplicas > 0 {
		return mesh.BUILD
	}
	if obj.Status.Replicas > obj.Status.ReadyReplicas {
		return mesh.BUILD
	}

	return mesh.READY
}
